
import './style/App.css';
import React,{Component} from "react";
import {BrowserRouter as Router, Routes, Route, Link} from 'react-router-dom';
import Layout from "./pages/Layout";



import MyEditor from "./components/Myeditor";
import MyTable from "./components/MyTable";
import MyHistory from "./pages/MyHistory";
import MyEditor2 from "./components/MyEditor2";
import Myeditor from "./components/Myeditor";

function Myrouters() {
    return (
        <Router>
            <>
                {/*<Link to="/home">首页</Link>*/}
                {/*<Link to="/citylist">菜单</Link>*/}
                {/*<Link to="/home/news">嵌套</Link>*/}
                {/*<Link to="/home/news2">嵌套2</Link>*/}
                {/*//新版本路由写法*/}
                {/*<Routes>*/}
                {/*  <Route path="/home" element={<Home />}>*/}
                {/*    <Route path="news" element={<News />}></Route>*/}
                {/*    <Route path="news2" element={<News2 />}></Route>*/}

                {/*  </Route>*/}
                {/*  <Route path="/citylist" element={<CityList />}></Route>*/}

                {/*</Routes>*/}
                {/*todo 1 被嵌套的路由在父路由内显示，未被嵌套的在主界面显示*/}
                <Routes>
                    <Route path="/" element={<Layout/>}>
                            {/*<Route path="news" element={<News />}></Route>*/}

                        <Route index element={<MyTable />}></Route>
                        <Route path="MyHistory" element={<MyHistory/>}></Route>

                    </Route>
                    <Route path="/Editor" element={<Myeditor/>}>
                    </Route>
                </Routes>
            </>
        </Router>

    );
}

export default Myrouters;






